﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/content.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>友情链接信息管理</title>
<script>
$(document).ready(function(){

		$("#name").focus();
		$("#linksForm").validate({
			 rules: { 
				name: { 
        			required: true, 
        			maxlength:10,
        			remote: "agentpayAction!checkName.action?orgName=${roles.name}&math="+Math.random()
    			}
			},
			messages: {
				name: {
					remote: "该角色已存在"
				}
			},
			success: function(label) {
				label.html("&nbsp;").addClass("checked");
	        }	
		});
	});	
</script>	
	</head>
	<body>
 	
		<div class="rhead">
			<div class="rpos">
				当前位置: 业务管理 - 会员类型信息管理  - 编辑会员类型信息管理
			</div>
			<div class="ropt"><input type="button" value="返回" onclick="history.back()"/></div>	
			<div class="clear"></div>
		</div>
		
		<form action="agentpayAction!update.action" method="post" id="linksForm" method="post">
			<input type="hidden" name="roles.id" value="${roles.id}"/>
		<table  align="center" class="listTable3" width="90%">
			<tr>
				<td>角色名称</td>
				<td>
					<input type="text" name="roles.name" value="${roles.name}"/>
				</td>
			</tr>
			<tr>
			<td>授权</td>
			<td>
					
					<table style="width:100%;">
							<tr>
									<td width="200px">套餐编号</td>
									<td width="200px">套餐名称</td>
									<td>会员价</td>
									<td>零售价</td>
							</tr>
					<c:forEach var="ep" items="${authoritiesList}">
					
						<tr><td><input  type="checkbox" name="checkedMenu" value="${ep.id}"
							
							<c:forEach var="rs" items="${roles.rolesAuthoritieses}">
								<c:if test="${ep.id==rs.authorities.id}">
									checked
								</c:if>
							</c:forEach>/>
						${ep.displayName}</td><td>${ep.name}</td>
							<c:forEach var="rs" items="${roles.rolesAuthoritieses}">
								<c:if test="${ep.id==rs.authorities.id}">
								<td><input type="input" 
								name="ep_${ep.id}" value="${rs.payment}" class="{required:true,maxlength:10,number:true}"/></td>
								<td><input type="input" 
								name="epre_${ep.id}" value="${rs.retailpayment}" class="{required:true,maxlength:10,number:true}"/></td>
								</c:if>
							</c:forEach>
						</tr>
					</c:forEach>
				</table>
			</td>
			</tr>
			<tr>
				<td>
					状态
				</td>
				<td>
					<select name="roles.state">
						<option value="1">已启用</option>
						<option value="0" <c:if test="${roles.state == 0}">selected</c:if>>
							已停用
						</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
				<input type="submit" value=" 提 交 "/>
				<input type="button" value=" 返 回 " onclick="history.back()"/>
				</td>
			</tr>
	 	</table>
	</form>
	</body>
</html>

